package com.mephi.oshs.model.interpreter.impl;

import com.mephi.oshs.model.interpreter.api.IContext;
import com.mephi.oshs.model.interpreter.api.IExpression;

public class EqualsExpression extends ComparisonExpression {

    public EqualsExpression(final IExpression expressionA, final IExpression expressionB) {
        super(expressionA, expressionB);
    }

    public void interpret(final IContext c) {
        expressionA.interpret(c);
        expressionB.interpret(c);
        final Boolean result = c.get(expressionA).equals(c.get(expressionB));
        c.addVariable(this, result);
    }
}